package duplexpipe.sni;

import java.net.Socket;
import java.text.SimpleDateFormat;
import java.util.Date;

public class CommonUtil {
	public static String getAddrAndPort(Socket socket, String mode)
	{
		return "Local : " + socket.getLocalSocketAddress().toString() + " Remote : " + socket.getRemoteSocketAddress().toString() ;
		
	}
	
	static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	
	public static void LogPrint(String message)
	{
		System.out.println(simpleDateFormat.format(new Date()) + " " + Thread.currentThread().getId() + " " +  message);
	}
}
